package person.learn.controller.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;
import java.util.Map;

/**
 * Created by barton on 16-1-29.
 * 1.测试springboot默认的资源配置时，要注释掉application.yml里边spring.mvc.view.suffix和spring.mvc.view.prefix配置项
 * 2.视图位置对应/resources/templates/freemarker/*.ftl
 */
@Controller
public class FreemarkerController {
    @Value("${learn.freemarker.message}")
    private String message;

    @RequestMapping("/freemarker")
    public String welcome(Map<String, Object> model) {
        model.put("time", new Date());
        model.put("message", this.message);
        System.out.println(123);
        return "freemarker/freemarkertest";
    }
}
